<%-- 
    Document   : show_account_statement
    Created on : Sep 20, 2012, 4:33:18 PM
    Author     : faizal.azlee
--%>

<%@page contentType="text/html" pageEncoding="windows-1252"%>
<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Pidahan Simpanan</title>
        <script type="text/javascript">
            $(document).ready(function(){
                $('form').submit( function () {
                    //return formValidation();
                    //return validate();
                }); 
            });
            
            
//             $('form').submit( function () {
//                    var hasError = false;
//                    $('.error').text('');
//                    var passwordVal = $("#password").val();
//                    var checkVal = $("#password-check").val();
//                    if (passwordVal == '') {
//                        $("#password").after('<span class="error">Sila masukan kata laluan.</span>');
//                        hasError = true;
//                    } else if (checkVal == '') {
//                        $("#password-check").after('<span class="error">Sila masukan kata laluan.</span>');
//                        hasError = true;
//                    } else if (passwordVal != checkVal ) {
//                        $("#password-check").after('<span class="error">Kata Laluan tidak sama.</span>');
//                        hasError = true;
//                    }
//                    if(hasError == true) {return false;}
//                });           
            function validate(f)
            {
                var patt=new RegExp("^([0-9]+)(.{0,1})([0-9]{0,2})$");
                var m = patt.test(document.getElementById("damaun").value);
                if(document.getElementById("noAkaun").value.trim().length!=15)
                {
                    $("#noAkaun").after('<span class="error">Sila masukan no akaun.</span>');
                    return false;
                }else if(m)
                {
                    blockUI();
                    f.action="${pageContext.request.contextPath}/deposit/transfer?Transfer_Step3";
                    f.submit();
                }else
                {
                    $("#damaun").after('<span class="error">Sila masukan amaun yang sah.</span>');
                    return false;
                }   
            }
            
            function resetAll()
            {
                document.getElementById("noAkaun").value="";
                document.getElementById("damaun").value=""
            }

        </script>
    </head>
    <body>
        <s:form action="/deposit/transfer" class="niceform">
            <s:hidden name="deposit.nama" id="nama"></s:hidden>
            <div id="content">
                <div id="logo">
                    <span>
                        <img src="${pageContext.request.contextPath}/images/img/ribbon.png"/>               
                    </span>
                </div>
                <h3>
                    Pindahan Simpanan
                </h3>
                <legend> </legend>
                <p>
                    <label>Dari Akaun TH :</label>${actionBean.deposit.noAkaunDari}                   
                </p>
                <p>
                    <label>Nama :</label>${actionBean.deposit.nama}                  
                </p>
                <p>
                    <label><font color="red">*</font>Ke Akaun :</label><s:text name="deposit.noAkaunPenerima" id="noAkaun" maxlength="15"/>
                </p>
                <p>
                    <label><font color="red">*</font>Jumlah (RM) :</label><s:text name="deposit.amaun" id="damaun"/>
                </p>             
                <p align="center">
                    <s:button name="Step3" value="Seterusnya" class="button green" onclick="validate(this.form)"/>
                    <s:button name="reset" value="Isi Semula" onclick="resetAll();" class="button green"/>
                </p>
                <p>
                        <label>&nbsp;</label>
                        <font size="2">Ruangan mandatori bertanda <font color="red">*</font> adalah wajib diisi.</font>
                </p>
            </div>
        </s:form>
    </body>
</html>
